#ifndef POPUP_UTILITIES_HPP
#define POPUP_UTILITIES_HPP

#include <QtGui>
#include <string>
#include <PopupLibTypes.hpp>

namespace utilities
{
  bool isSupportedImage(const char *p_filename);
  bool isSupportedVideo(const char *p_filename);
  bool isSupportedImage(const std::string & p_filename);
  bool isSupportedVideo(const std::string &p_filename);
  bool createDirectory(const std::string & p_path);
  bool openUrl(const std::string & p_url);
  bool openMedia(const std::string & p_media);
  bool openImage(const std::string & p_media);
  void showError(const QString & p_text, QWidget *p_parent = 0);
  void showWarning(const QString & p_text, QWidget *p_parent = 0);
  bool confirm(const QString & p_text, QWidget *p_parent = 0);
  bool extractResource(const QString & p_rcname,
                       const QString & p_destfile);
  void selectFileToTextEdit(QLineEdit *p_edit, QWidget *p_parent = 0,
			    const QString & p_title  = "Please select a file",
			    const QString & p_filter = "All files (*)",
			    const QString & p_defaultfile = "");
  void selectDirToTextEdit(QLineEdit *p_edit, QWidget *p_parent = 0,
			   const QString & p_title  = "Please select a directory");
  Popup::UserMode modeFromString(QString p_mode);
  QString modeToString(Popup::UserMode p_mode);
  QImage createImageWithOverlay(const QImage & baseImage,
                                const QImage & overlayImage,
                                const QImage & overlayImage2 = QImage());
};

#endif // POPUP_UTILITIES_HPP
